/**
 * (c) 2006 JOVEN
 * 
 * http://www.joven.com.cn
 */
package me.cloudcat.develop.entity.configuration;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Index;
import org.hibernate.validator.constraints.Length;

import me.cloudcat.develop.entity.BaseEntity;

/**
 * 
 * @author ZZWang
 * @Time 2017年1月17日 下午2:42:44
 *
 */
@Entity
@Table(name = "tbl_department")
//@SequenceGenerator(name = "SEQ_STORE", sequenceName = "TBL_DEPARTMENT_ID_ASQ", allocationSize = 1)
public class Department extends BaseEntity<Department> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1990267479889920523L;

	@NotNull
	@Length(max = 50)
	@Index(name = "idx_department_name")
	private String name;

	private String description;

	/**
	 * 排序
	 */
	private int pos;

	@ManyToOne(fetch = FetchType.EAGER)
	private Department parentDepartment;

	@Version
	private int version;

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public Department getParentDepartment() {
		return parentDepartment;
	}

	public void setParentDepartment(Department parentDepartment) {
		this.parentDepartment = parentDepartment;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getPos() {
		return pos;
	}

	public void setPos(int pos) {
		this.pos = pos;
	}

}
